#define _CRT_SECURE_NO_WARNINGS  1
#include<stdio.h>
void rev(int* arr,int n)
{
	int a = 0, b = 0;
	while (b <= n - 1)
	{
		if (*(arr+b) % 2 != 0)
		{
			int tmp;
			tmp = *(arr + b);
			*(arr + b) = *(arr + a);
			*(arr + a) = tmp;
			a++;
			b++;
		}
		else
		{
			b++;
		}
	}
}
int main()
{

	int arr[10];
	for (int i = 0; i < 10; i++)
	{
		scanf("%d", &arr[i]);
	}
	rev(arr,10);

	for (int i = 0; i < 10; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}